<?php

class Application_Form_Visiteur extends Zend_Form {

    public function init() {
        $this->setName('viviteur');

        $id = new Zend_form_Element_Text('id');
        $id->setLabel('Identifiant')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');
        $nom = new Zend_form_Element_Text('nom');
        $nom->setLabel('Nom')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');
        $prenom = new Zend_form_Element_Text('prenom');
        $prenom->setLabel('Prenom')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');
        $adresse = new Zend_form_Element_Text('adresse');
        $adresse->setLabel('Adresse')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');
        $validatorCp = new Zend_Validate_StringLength(array('max' => 5));
        $cp = new Zend_form_Element_Text('cp');
        $cp->setLabel('Cp')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty')
                ->addValidator($validatorCp)
                ->addValidator('Digits');
        $ville = new Zend_form_Element_Text('ville');
        $ville->setLabel('Ville')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');
        $dateEmbauche = new Zend_form_Element_Text('dateEmbauche');
        $dateEmbauche->setLabel('Date Embauche')
                ->setRequired(true)
                ->addFilter('StripTags')
                ->addFilter('StringTrim')
                ->addValidator('NotEmpty');
        $envoyer = new Zend_form_Element_Submit('envoyer');
        $envoyer->setLabel('id', 'boutonenvoyer');

        $this->addElements(array($id, $nom, $prenom, $adresse, $cp, $ville, $dateEmbauche, $envoyer));
    }

}
